php round function Passing parameters with mode.

61

<?php
// round to nearest even value
echo(round(10.5,0,PHP_ROUND_HALF_EVEN));
echo "<br>";
 
// round to nearest odd value
echo(round(10.5,0,PHP_ROUND_HALF_ODD));
echo "<br>";
 
// round towards zero
echo(round(10.5,0,PHP_ROUND_HALF_DOWN));
echo "<br>";
 
// round away from zero
echo(round(10.5,0,PHP_ROUND_HALF_UP));
?>

Comments

Submit
0 Comments